import React, { Component } from 'react'
import { withRouter, Route } from 'react-router-dom'

class Login extends Component {
    login = () => {
        sessionStorage.setItem('token', "1")
        // replace不会保留原来的记录
        this.props.history.push(this.props.location.state.back)
        // console.log()
    }
    render() {
        return (
            <div>
                <p>
                    账号：<input type="text" />
                </p>
                <button onClick={() => {
                    this.login()
                }}>登录</button>
            </div>
        )
    }
}


Login = withRouter(Login)

export default Login
